<template>
  <div class="">
    <img
      src="@/assets/game/myPlane.jpeg"
      class="my-plane"
      :style="{top:postion.y - 40 + 'px',left:postion.x + 'px'}"
    />
  </div>
</template>
  
  <script>
export default {
  name: "my-plane",
  props: {
    coo: {
      type: Object,
    },
  },
  data() {
    return {
        postion:{}
    };
  },
  mounted(){
    this.postion = this.coo
  },
  watch: {
    coo(val1){
        this.postion = val1
        //当发生变化的时候发射子弹

    }
  },
  methods: {
    sendBullit(){

    }
  },
};
</script>
  
  <style scoped>
.my-plane {
  width: 60px;
  height: 80px;
  /**默认位置在最下面 */
  position: absolute;
  bottom: 0px;
  left: 50%;
  transform: translate(-50%);
  z-index: 999;
}

</style>
  